package puzzle.projecteuler.p200;

import astudy.util.AdvMath;

public class Problem123D {

	/**
	 * r = 2    (mod pn^2) n is even
	 * r = 2n*pn (mod pn^2) n is odd
	 * @param args
	 */
	public static void main(String[] args) {

		Integer[] ps = AdvMath.primes(1000000);

		for (int i = 0; i < ps.length; i ++) {
			int n = i+1;
			long a = (long)2*n*ps[i];
			if (n%2 == 1 &&  a> 10000000000L) {
				System.out.println(n);
				break;
			}
		}
	}

}
